import {Trigger} from "../IEffectContainer";

export class cd extends Trigger {

    /**
     * cd判定
     * @param {any} condition 数据格式如下的对象
     * {
     *  cd: number[];
     *  level: number;
     *  lastUsedTime: number;
     * }
     */
    shouldTrigger(condition: any): boolean {
        let cd = condition.cd[condition.level - 1]
        let result = (Date.now() - condition.lastUsedTime) >= cd * 1000
        return result;
    }

}
